import Compressor from 'compressorjs'
export function compressorImg(file: File) {
  return new Promise((resolve, rejcet) => {
    new Compressor(file, {
      quality: 0.8,
      convertSize: 1000,
      success(result) {
        // console.log(result, '压缩后文件', result.size)
        resolve(result)
      },
      error(err) {
        rejcet(err)
        console.log(err.message, '压缩错误')
      }
    })
  })
}
